import 'dart:math';

import 'package:flutter/material.dart';

class MessageNotificationBox extends StatelessWidget {
  final String? title;
  final String? icon;
  final String routePath;

  MessageNotificationBox(
      {@required this.title, this.icon, required this.routePath});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
        height: 90,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Container(
              child: ClipRRect(
                  borderRadius: BorderRadius.circular(90),
                  child: Image.asset(
                    icon!,
                    fit: BoxFit.cover,
                    width: 60,
                    height: 60,
                  )),
            ),
            Container(
              child: Text(
                title!,
                style: TextStyle(
                  fontSize: 16,
                  // fontWeight: FontWeight.bold
                ),
              ),
            )
          ],
        ),
      ),
      onTap: () {
        Navigator.pushNamed(context, routePath);
      },
    );
  }
}

class CirclePainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    final Paint paint = Paint()
      ..color = Colors.blue
      ..style = PaintingStyle.fill;
    canvas.drawCircle(
        size.center(Offset.zero), min(size.width, size.height) / 2, paint);
  }

  @override
  bool shouldRepaint(CustomPainter oldDelegate) {
    return false;
  }
}
